Code Monkey home page Code Monkey logo

ml-table-football's Introduction

Adversarial Self-Play Table Football Environment for Unity ML-Agents - Video

This is a table football environment for Unity Machine Learning Agents, using adversarial self-play.

Agents can manipulate the player rods by exerting forces and torques. I wasn't able to achieve realistic looking rolling ball physics, which might be due to a scale issue. Instead, I went for a sliding puck like behaviour: The ball's material is frictionless, the rigidbody's drag slows it down. The ball receives a random kick if its velocity drops below a threshold value defined in Ball.cs. Bouncing off the table walls is handled through code.

Agents receive rewards for scoring goals and penalties for conceding them. In all my training attempts thus far, agents eventually ended up spinning the player rods continuously. An optional per-step spin penalty can be added to counteract this. Furthermore, shots can be rewarded proportional to the vector dot product of the ball's velocity and the direction towards the goal (relative to the ball's position). If enabled, this reward is set for each step while an agent controls the ball. Ball possession starts when an agent player first kicks the ball and ends either when an opponent player touches it, when a goal is scored, or when the ball's velocity drops under the threshold as described above. The minimap UI visualizes ball possession as color trails.

Dependencies: Unity Machine Learning Agents 0.14.1
The FootballAgent class needs to access agentParameters.maxStep from the base Agent class for providing game progress to the stats UI. Please change AgentParameters struct and agentParameters field from internal to protected in Agent class line 124ff.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.