Crew & Workers¶
Crew creation¶
StationWorkerManager observes detected rooms. A worker is spawned when:
- the room type is the configured Crew Quarters definition;
- the room is operational or waiting only for staffing;
- an unclaimed
Sleepinteraction slot exists; - the room has not reached its configured worker limit.
The supplied Crew Quarters requires both Rest and Crew tag scores. In the demo, a Bed supplies Rest and a Locker supplies Crew.
Worker visual variants¶
The worker manager supports a single fallback prefab or an array of prefab variants. The clean demo randomly selects between the Ruby and Amber worker wrappers.
Create or repair the wrappers with:
Tools > Pixit Games > Space Station Survival > Create Worker Prefab Templates
Existing worker prefabs are preserved so authored Animator and model adjustments are not overwritten.
Needs and oxygen¶
CrewVitals tracks:
- health;
- personal oxygen;
- hunger;
- thirst;
- fatigue;
- stress;
- current room.
Each worker contributes room oxygen consumption to the station summary. In a safe room, personal oxygen recovers. In unsafe atmosphere, personal oxygen falls and eventually causes health damage.
Assigning work¶
A staffed machine contains WorkerRequirement and one or more Work interaction slots.
The default UI workflow is:
- turn Build Mode off;
- select the target room;
- press Assign Worker;
- the manager finds an available worker and open work slot;
- the worker reserves the slot and walks to it;
- production begins only after the worker occupies the slot.
An assigned worker does not stand at the machine forever. It accumulates fatigue, releases the active slot, returns to its bed, sleeps, and then attempts to resume the same assignment.
Worker pathfinding¶
Workers follow floor-cell paths rather than moving in a direct line through geometry.
- Wall boundaries are never traversed.
- Door and Airlock boundaries are treated as usable portals.
- The pathfinder first attempts to avoid blocking placeables.
- If furniture fills a compact room, it can fall back to the connected floor-cell route while still respecting walls.
- Missing floor cells and different stories are not traversable.
If no route exists, assignment is rejected and the Console reports start and target cells with floor availability.
Select a worker in the Scene view to display its current route gizmo.
Grounding and interaction poses¶
Walking workers are projected to the current story's floor plane. An interaction can temporarily move the worker root to a different poseāfor example, onto a bed. When the worker leaves that pose, it returns to the floor plane before pathfinding.
If a model still floats after runtime grounding, adjust the model child's local Y position under the worker prefab's Visual Root; that indicates a model-pivot offset rather than a path height issue.
Extending behaviour¶
The supplied state machine is intentionally lightweight. Projects can replace direct movement with NavMesh, steering, network authority, schedules, inventory jobs, or a behaviour tree while retaining room ownership, interaction slots, staffing requirements, and vitals.