Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Showcase ML Agents training of an asymmetric adversarial simulation

Discussion in 'ML-Agents' started by ChillX, Feb 4, 2022.

?

Is this type of post useful to anyone ?

  1. Yes it is useful

    100.0%
  2. No it is a waste of time and space

    0 vote(s)
    0.0%
  1. ChillX

    ChillX

    Joined:
    Jun 16, 2016
    Posts:
    145
    Note: This post is becoming far too long for a forum post. So I moved it to an article on Medium.Com instead.

    Note: I'm developing this to be eventually launched as a game. Just sharing the ML agents training experience in case it might help someone else trying a similar scenario.

    Disclaimer: There are probably a million good ways to do this. I just chose one after testing a few over the last few months.

    The article is in 4 parts and I'm publishing it as the project evolves.

    Part 1:
    https://medium.com/@TCWicks/jellyze...ic-adversarial-simulation-part-1-cc2c295316fb

    Part 2:
    https://medium.com/@TCWicks/jellyze...ic-adversarial-simulation-part-2-5770f3b923ad

    Part 3:
    https://medium.com/@TCWicks/jellyze...ic-adversarial-simulation-part-3-437a74653269

    Screenshot of game level 1

    GameLevel0.JPG

    Gabe Rules:

    The Green Cube is ML Agents powered and represents the player.
    The Red Cube is ML Agents powered and represents the enemy game AI
    The Blue Cube is the target kind of like the football in soccer
    The Purple Square is checkpoint kind of like the goal in soccer.
    The Yellow Cubes are blockers which can only be moved by the green cube "player" and not by the red cube "enemy"

    The objective of the game is for the green cube "player" to push the blue cube "target" to the purple square "checkpoint". The red cube "enemy" must prevent that by pushing the blue cube "target" away from the purple square "checkpoint"
    The yellow blocker cubes and the target cube cannot be moved right next to the edge of the game map. Otherwise corners create a stalemate where the cube cannot be moved out again.
    The number of targets / checkpoints / blockers is variable and configurable via config file parameters
    Reward components can also be turned on and off via config file parameters

    The rules of the game are stacked in favor of the player.

    Screenshot of all 5 game levels:

    GameLevel01234.JPG
     
    Last edited: Feb 12, 2022