Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question AI for a card game

Discussion in 'ML-Agents' started by Michael_Vu, Feb 1, 2021.

  1. Michael_Vu


    Aug 10, 2018
    Hi, I need some advices about building an AI for a card game.

    There are 5 players play in a 5x5 board, each player draws 5 cards at the beginning. A turn starts with a player roll a dice. The player will move the amount of steps same as the dice number. There are some special tiles that can move the player backwards. Depend on where the player landed, each player may play a card, and choose who they want to apply the card’s effect on. Then the player who started the turn (rolled the dice) draws a card. Then each player may play a card again. At the end of the turn, if the player who started the turn has more than 5 cards, they will need to discard those exceeding amount. Whoever reach the last tile first wins the game.

    Using my setup, it seem doesn’t work so far. I think mostly because of the randomness and the amount of cards. I had trained it for a day, and it was still so dumb. The ELO went from 0 to maximum 90. Now, I’m thinking about other solutions like Monte Carlo algorithm, but still not sure if it works.

    Should I continue with ML-Agents (with different setup obviously)? Or does anyone know other solutions?
  2. ervteng_unity


    Unity Technologies

    Dec 6, 2018
    Hey Michael, what do your ELO curves look like? ELO should start at 1200 and go up from there. Also, how are the observations set up?

    ML-Agents is definitely better for reactive behaviors (e.g. soccer or racing) than planning (card games, board games). But if your game only requires a couple steps of planning, it might be possible to use observation stacking or memory to get the agent to be smarter.