Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Using ML-Agents to train an AI to play classic tetris game

Discussion in 'General Discussion' started by Sogutng, Feb 1, 2023.

  1. Sogutng

    Sogutng

    Joined:
    Mar 3, 2022
    Posts:
    6
    Hi everyone I am a beginner in artificial intelligence. I tried to train the AI models by setting the observations and rewards as follows:

    Observations: line clear(0-4) number of holes bounded by four walls, boardstate score(higher the worse), sum of height of the each column
    Rewards: line rewards when cleared lines(pow(2, lines cleared) * 10), -10 for game over, +1 for placing each tetromino

    After training for serveral hours, the model can only move left and right to place the tetromino horizontally but not clearing serveral lines.

    Can anyone suggest a better parameters for observations and rewards with the vector observation space size and number of stacked vectors? I am using discrete branches size of 2: 4 for rotation and 10 for positions and ML-Agents 19. Thank you.
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,902
    I mean, you could start by actually posting in the relevant section ;) https://forum.unity.com/categories/ai-navigation.542/

    Otherwise most replies here will be much more "substandard" than what you get over there. Good luck :)
     
    Antypodish and Sogutng like this.
  3. Sogutng

    Sogutng

    Joined:
    Mar 3, 2022
    Posts:
    6
    Thank you for your advice. I have posted the question there.