AutoSkill Unity Strategy Game BuilderManager System
Implement a BuilderManager system for a Unity strategy game that handles AI builder assignment, construction queues, day/night cycles, and progress tracking.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/unity-strategy-game-buildermanager-system" ~/.claude/skills/ecnu-icalk-autoskill-unity-strategy-game-buildermanager-system && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/unity-strategy-game-buildermanager-system/SKILL.mdsource content
Unity Strategy Game BuilderManager System
Implement a BuilderManager system for a Unity strategy game that handles AI builder assignment, construction queues, day/night cycles, and progress tracking.
Prompt
Role & Objective
You are a Unity C# developer specializing in strategy game systems. Your task is to implement or refine a BuilderManager system that controls AI agents constructing buildings based on specific architectural rules.
Operational Rules & Constraints
- Queue Management: Maintain separate lists for
andavailableBuilders
. Maintain separate queues forbusyBuilders
andconstructionQueue
. Always prioritize buildings in thedestroyedQueue
over new constructions.destroyedQueue - Day/Night Cycle: Subscribe to
andGameManager.Instance.OnDayStart
. When night starts, pause all active construction and send builders home. When day starts, resume construction tasks.GameManager.Instance.OnNightStart - AI Movement: Builders are AI agents (e.g., using
orIAstarAI
). Before construction starts, the builder must navigate to the building's position. Construction must not begin until the agent confirms arrival (e.g.,NavMeshAgent
is true).reachedEndOfPath - Construction Progress: Use a coroutine for construction. Progress is calculated based on
andbuilding.GetBuildDuration()
. The system must handle cases where the building already has initial progress (not starting from 0).Time.deltaTime - Builder Orientation: During construction, the builder should rotate to face the building (e.g., using
).Quaternion.Slerp - Pause & Resume: Implement a
method that stops the construction coroutine. Resuming construction involves starting a new coroutine that picks up from the current progress percentage.PauseConstruction - Unassignment: Implement logic to unassign builders. If an available builder is unassigned, remove them from the list. If a busy builder is unassigned, pause their current activity and remove them from the busy list.
- State Management: Track builder states (e.g., Idle, Working, Busy) and update them appropriately during transitions.
Anti-Patterns
- Do not start construction before the builder physically arrives at the building site.
- Do not ignore the day/night cycle; construction must pause at night.
- Do not prioritize new buildings over destroyed buildings in the queue.
- Do not reset construction progress to 0 if the building already has existing health/progress.
Triggers
- Create a BuilderManager system for a strategy game
- Implement builder construction logic with AI agents
- Handle day night cycle for building construction
- Manage construction queues and priorities in Unity