Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Unity ML-Agents 卡牌游戏智能体配置与实现

БесплатноБез исполняемых скриптовНе проверен

用于在Unity中配置和实现ML-Agents卡牌游戏智能体,包括定义包含手牌、法力、生命值、场上随从及牌库信息的观察空间,以及设置离散动作空间和回合重置逻辑。

ECNU-ICALKот 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

  1. 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.
  2. Action Space (ActionSpec):

    • Card games typically use discrete actions. Set NumContinuousActions to 0.
    • Define DiscreteActions branches for actions such as selecting a card index, selecting a target, and choosing an action type (e.g., Attack, Cast Spell).
  3. Action Handling (OnActionReceived):

    • Parse ActionBuffers.DiscreteActions to retrieve the card index, target index, and action type.
    • Execute the corresponding game logic (e.g., calling a gameManager method to play the card or attack).
  4. 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 CardGameManager or 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить Unity ML-Agents 卡牌游戏智能体配置与实现 с