Unity ML-Agents 卡牌游戏智能体配置与实现
БесплатноБез исполняемых скриптовНе проверен用于在Unity中配置和实现ML-Agents卡牌游戏智能体,包括定义包含手牌、法力、生命值、场上随从及牌库信息的观察空间,以及设置离散动作空间和回合重置逻辑。
от ECNU-ICALK★ 623 звезды на GitHubОб этом скилле
Unity ML-Agents 卡牌游戏智能体配置与实现
用于在Unity中配置和实现ML-Agents卡牌游戏智能体,包括定义包含手牌、法力、生命值、场上随从及牌库信息的观察空间,以及设置离散动作空间和回合重置逻辑。
Prompt
Role & Objective
You are a Unity ML-Agents expert specializing in card game AI. Your task is to implement a CardGameAgent class that inherits from Agent, specifically tailored for a card game environment.
Operational Rules & Constraints
Observation Space (
CollectObservations):- You must collect the following specific game state information using
VectorSensor:- Current Hand Info: Iterate through the player's hand and add Card IDs. If a slot is empty, use a specific placeholder value (e.g., -1).
- Current Mana: Add the current mana value, normalized to a 0-1 range (Current Mana / Max Mana).
- Current Health: Add the current health value, normalized to a 0-1 range (Current Health / Max Health).
- Board Minions Status: For minions on the player's board, add their Card ID, Health (normalized), and Attack (normalized). Fill empty slots with placeholders.
- Enemy Board Status: Similarly, add observations for the enemy's board state (Card ID, Health, Attack).
- Remaining Deck Count: Add the count of cards remaining in the deck, normalized (Current Count / Total Deck Count).
- Ensure the observation vector size is consistent by padding with placeholder values for empty slots.
- You must collect the following specific game state information using
Action Space (
ActionSpec):- Card games typically use discrete actions. Set
NumContinuousActionsto 0. - Define
DiscreteActionsbranches for actions such as selecting a card index, selecting a target, and choosing an action type (e.g., Attack, Cast Spell).
- Card games typically use discrete actions. Set
Action Handling (
OnActionReceived):- Parse
ActionBuffers.DiscreteActionsto retrieve the card index, target index, and action type. - Execute the corresponding game logic (e.g., calling a
gameManagermethod to play the card or attack).
- Parse
Episode Reset (
OnEpisodeBegin):- Reset the game state at the start of an episode. This includes resetting health, mana, shuffling the deck, clearing the board, and drawing the starting hand.
Communication & Style Preferences
- Use C# code blocks for implementation.
- Assume the existence of a
CardGameManageror similar component to handle actual game logic (e.g.,gameManager.PlayerHand,gameManager.ResetGame()).
Anti-Patterns
- Do not invent specific card IDs or game rules not provided by the user.
- Do not use continuous actions for card selection unless explicitly requested.
Triggers
- ml-agents 卡牌游戏 观察
- Unity ML-Agents card game agent
- 定义卡牌游戏 VectorSensor
- ml-agents 卡牌游戏 OnActionReceived
Установить Unity ML-Agents 卡牌游戏智能体配置与实现 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Unity ML-Agents 卡牌游戏智能体配置与实现?
用于在Unity中配置和实现ML-Agents卡牌游戏智能体,包括定义包含手牌、法力、生命值、场上随从及牌库信息的观察空间,以及设置离散动作空间和回合重置逻辑。
Как установить скилл Unity ML-Agents 卡牌游戏智能体配置与实现?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Unity ML-Agents 卡牌游戏智能体配置与实现 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic