Git Product home page Git Product logo

gym-soccer's Introduction

Status: Archive (code is provided as-is, no updates expected)

gym-soccer

The Soccer environment is a multiagent domain featuring continuous state and action spaces. Currently, several tasks are supported:

Soccer

The soccer task initializes a single offensive agent on the field and rewards +1 for scoring a goal and 0 otherwise. In order to score a goal, the agent will need to know how to approach the ball and kick towards the goal. The sparse nature of the goal reward makes this task very difficult to accomplish.

SoccerEmptyGoal

The SoccerEmptyGoal task features a more informative reward signal than the Soccer task. As before, the objective is to score a goal. However, SoccerEmtpyGoal rewards the agent for approaching the ball and moving the ball towards the goal. These frequent rewards make the task much more accessible.

SoccerAgainstKeeper

The objective of the SoccerAgainstKeeper task is to score against a goal keeper. The agent is rewarded for moving the ball towards the goal and for scoring a goal. The goal keeper uses a hand-coded policy developed by the Helios RoboCup team. The difficulty in this task is learning how to shoot around the goal keeper.

Installation

cd gym-soccer
pip install -e .

gym-soccer's People

Contributors

catherio avatar christopherhesse avatar mhauskn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gym-soccer's Issues

No activity on the field

I run the environment with standard tool:

python3 examples/scripts/sim_env --mode random  SoccerEmptyGoal-v0

Soccer field is displayed in separate window, but where is no activity.

There are also many error messages in console:
0: error: Illegal player side. . 0 ".5741 -0.9172 0 0) ((l 1) 0 0 -3 -37 -0 -0 0 0 (v h 90) (s 8000 1 1 130600) ...

Is that a correct way to use the environment?

Installation issue

pip install gym-soccer indicates that there's no matching package.

pip install -e . in the repo folder returns this error :(

Requirement already satisfied: gym>=0.2.3 in /Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages (from gym-soccer==0.0.1)
Collecting hfo_py>=0.2 (from gym-soccer==0.0.1)
  Using cached hfo-py-0.2.tar.gz
Requirement already satisfied: pyglet>=1.2.0 in /Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages (from gym>=0.2.3->gym-soccer==0.0.1)
Requirement already satisfied: six in /Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages (from gym>=0.2.3->gym-soccer==0.0.1)
Requirement already satisfied: requests>=2.0 in /Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages (from gym>=0.2.3->gym-soccer==0.0.1)
Requirement already satisfied: numpy>=1.10.4 in /Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages (from gym>=0.2.3->gym-soccer==0.0.1)
Building wheels for collected packages: hfo-py
  Running setup.py bdist_wheel for hfo-py ... error
  Complete output from command /Users/QV/code-project/learn/reinforcement_learning/venv/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/tmpv_x4qxrgpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  Cloning into 'hfo_py'...
  -- The C compiler identification is AppleClang 8.1.0.8020042
  -- The CXX compiler identification is AppleClang 8.1.0.8020042
  -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
  -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
  -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Warning at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:765 (message):
    Imported targets not available for Boost version
  Call Stack (most recent call first):
    /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:11 (find_package)


  CMake Warning at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:765 (message):
    Imported targets not available for Boost version
  Call Stack (most recent call first):
    /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
    /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
    CMakeLists.txt:11 (find_package)


  CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindBoost.cmake:1842 (message):
    Unable to find the requested Boost libraries.

    Unable to find the Boost header files.  Please set BOOST_ROOT to the root
    directory containing Boost or BOOST_INCLUDEDIR to the directory containing
    Boost's headers.
  Call Stack (most recent call first):
    CMakeLists.txt:11 (find_package)


  -- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8")
  -- Found FLEX: /usr/bin/flex (found version "2.5.35")
  CMake Error at /usr/local/Cellar/cmake/3.8.1/share/cmake/Modules/FindQt4.cmake:1318 (message):
    Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
  Call Stack (most recent call first):
    CMakeLists.txt:41 (find_package)


  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  Boost_INCLUDE_DIR (ADVANCED)
     used as include directory in directory /private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/hfo_py
     used as include directory in directory /private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/hfo_py
     used as include directory in directory /private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/hfo_py
     used as include directory in directory /private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/hfo_py

  -- Configuring incomplete, errors occurred!
  See also "/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/hfo_py/CMakeFiles/CMakeOutput.log".
  Could not build hfo-py: Command '['cmake', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py", line 31, in <module>
      include_package_data=True
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 199, in run
      self.run_command('build')
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py", line 14, in run
      subprocess.check_call(['cmake','-DCMAKE_BUILD_TYPE=Release'], cwd='hfo_py')
    File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 584, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1

  ----------------------------------------
  Failed building wheel for hfo-py
  Running setup.py clean for hfo-py
Failed to build hfo-py
Installing collected packages: hfo-py, gym-soccer
  Running setup.py install for hfo-py ... error
    Complete output from command /Users/QV/code-project/learn/reinforcement_learning/venv/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-ch7hup6a-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/QV/code-project/learn/reinforcement_learning/venv/bin/../include/site/python3.5/hfo-py:
    running install
    running build
    fatal: destination path 'hfo_py' already exists and is not an empty directory.
    Could not build hfo-py: Command '['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py']' returned non-zero exit status 128.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py", line 31, in <module>
        include_package_data=True
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/QV/code-project/learn/reinforcement_learning/venv/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/command/install.py", line 539, in run
        self.run_command('build')
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py", line 13, in run
        subprocess.check_call(['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py'])
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 584, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py']' returned non-zero exit status 128

    ----------------------------------------
Command "/Users/QV/code-project/learn/reinforcement_learning/venv/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-ch7hup6a-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/QV/code-project/learn/reinforcement_learning/venv/bin/../include/site/python3.5/hfo-py" failed with error code 1 in /private/var/folders/w4/3w7fvl4n4sqdzt2d49qj9p1c0000gn/T/pip-build-db1mrcg4/hfo-py/

Not able to install

I am getting the following error on installation.

running install running build fatal: destination path 'hfo_py' already exists and is not an empty directory. Could not build hfo-py: Command '['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py']' returned non-zero exit status 128.. Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\WIN10~1\AppData\Local\Temp\pip-install-ogr72o6o\hfo-py\setup.py", line 31, in <module> include_package_data=True File "c:\users\win 10\appdata\local\programs\python\python36\lib\site-packages\setuptools\__init__.py", line 129, in setup return distutils.core.setup(**attrs) File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\core.py", line 148, in setup dist.run_commands() File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\dist.py", line 955, in run_commands self.run_command(cmd) File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "c:\users\win 10\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\install.py", line 61, in run return orig.install.run(self) File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\command\install.py", line 545, in run self.run_command('build') File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "c:\users\win 10\appdata\local\programs\python\python36\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "C:\Users\WIN10~1\AppData\Local\Temp\pip-install-ogr72o6o\hfo-py\setup.py", line 13, in run subprocess.check_call(['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py']) File "c:\users\win 10\appdata\local\programs\python\python36\lib\subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/LARG/HFO.git', 'hfo_py']' returned non-zero exit status 128.

how to use gym-soccer

I have installed gym-soccer and I want to create the gym-soccer environment by running:
import gym
env = gym.make('Soccer-v0')

but it failed. What's the problem? I didn't find any examples using gym-soccer.

support for multi-agent damain

The introduction of gym-soccer says

The Soccer environment is a multiagent domain featuring continuous state and action spaces.

However, currently the gym-soccer only supports:
offense_agents=1,
defense_agents=0,
offense_npcs=0,
defense_npcs=0

Could it be updated that we can specify the number of offense_agents, defense_agents, offense_npcs and defense_npcs? Also, in this case, we can get the states of all the agents at the same time.

ERROR: Failed building wheel for hfo-py

I ran these codes:!pip install -e git+https://github.com/cycraig/gym-soccer#egg=gym_soccer in Google Colab
here is an error:
`Obtaining gym_soccer from git+https://github.com/cycraig/gym-soccer#egg=gym_soccer
Updating ./src/gym-soccer clone
Running command git fetch -q --tags
Running command git reset --hard -q a65f514
Requirement already satisfied: gym>=0.2.3 in /usr/local/lib/python3.6/dist-packages (from gym_soccer) (0.17.3)
Collecting hfo_py>=0.2
Using cached https://files.pythonhosted.org/packages/d8/b7/fce181f43b01e3908b70bc2eabd5fa271e89ade5b1a492682af9706b6412/hfo-py-0.2.tar.gz
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /usr/local/lib/python3.6/dist-packages (from gym>=0.2.3->gym_soccer) (1.5.0)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from gym>=0.2.3->gym_soccer) (1.4.1)
Requirement already satisfied: cloudpickle<1.7.0,>=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym>=0.2.3->gym_soccer) (1.3.0)
Requirement already satisfied: numpy>=1.10.4 in /usr/local/lib/python3.6/dist-packages (from gym>=0.2.3->gym_soccer) (1.19.4)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet<=1.5.0,>=1.4.0->gym>=0.2.3->gym_soccer) (0.16.0)
Building wheels for collected packages: hfo-py
Building wheel for hfo-py (setup.py) ... error
ERROR: Failed building wheel for hfo-py
Running setup.py clean for hfo-py
Failed to build hfo-py
Installing collected packages: hfo-py, gym-soccer
Running setup.py install for hfo-py ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tfehppeh/hfo-py/setup.py'"'"'; file='"'"'/tmp/pip-install-tfehppeh/hfo-py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-k3q4wtvg/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

`

Problem with AgainstKeeper?

I am able to create instances of Soccer-v0 and SoccerEmptyGoal-v0 without any problem. But when I try to create an instance of SoccerAgainstKeeper-v0 by env = gym.make('SoccerAgainstKeeper-v0'), I get the following error message:

[2016-11-11 03:42:29,228] Making new env: SoccerAgainstKeeper-v0
Traceback (most recent call last):
File "", line 1, in
File "/home/aykan/gym/gym/envs/registration.py", line 130, in make
return registry.make(id)
File "/home/aykan/gym/gym/envs/registration.py", line 95, in make
return spec.make()
File "/home/aykan/gym/gym/envs/registration.py", line 70, in make
cls = load(self._entry_point)
File "/home/aykan/gym/gym/envs/registration.py", line 18, in load
result = entry_point.load(False)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2239, in resolve
raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'SoccerAgainstKeeperEnv'

Any idea why this might be the case? I want to work on this problem for a class project, so any input will be appreciated!

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.