diff --git a/.dockerignore b/.dockerignore index d33f6723..fb4716bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,4 @@ gfootball.egg-info football-env* .vs .idea +dist/ diff --git a/gfootball/.github/workflows/publish-wheels.yml b/.github/workflows/publish-wheels.yml similarity index 98% rename from gfootball/.github/workflows/publish-wheels.yml rename to .github/workflows/publish-wheels.yml index cd0a6207..28737a46 100644 --- a/gfootball/.github/workflows/publish-wheels.yml +++ b/.github/workflows/publish-wheels.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v2 with: repository: microsoft/vcpkg - ref: 47d2378c8181ece05ffc51acd2ed60d97e3c9a64 + ref: 8e0a801c6253a2c8e81f59427a4a5d66f10c0ca4 path: vcpkg fetch-depth: 0 diff --git a/.gitignore b/.gitignore index 00d6f83f..f1edacbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ third_party/gfootball_engine/build* build/ -gfootball.egg-info +*.egg-info __pycache__ *.a *.so @@ -16,3 +16,4 @@ cmake-build-debug/ .idea .vs vcpkg_installed/ +dist/ diff --git a/CHANGELOG b/CHANGELOG index cebeb6b5..83b4e4d5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,10 @@ should not change, as modifications made to the environment are either new features or backward compatible bug fixes. We will maintain vX branches pointing at the most recent vX.Y. +v2.10.1 +- Improve crash reporting in the engine. +- Update environment tests. + v2.10 - Windows support. - Development mode (pip install -e .) diff --git a/README.md b/README.md index 0a35b963..952823f0 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,7 @@ brew install git python3 cmake sdl2 sdl2_image sdl2_ttf sdl2_gfx boost boost-pyt python3 -m pip install --upgrade pip setuptools psutil wheel ``` -To set up `pygame`, it is also required to install older versions of SDL: -``` -brew install sdl sdl_image sdl_mixer sdl_ttf portmidi -``` #### Windows Install [Git](https://git-scm.com/download/win) and [Python 3](https://www.python.org/downloads/). diff --git a/gfootball/doc/observation.md b/gfootball/doc/observation.md index da24f38e..f7c5c357 100644 --- a/gfootball/doc/observation.md +++ b/gfootball/doc/observation.md @@ -16,7 +16,7 @@ Environment exposes following `raw` observations: - `left_team_direction` - N-elements vector with [x, y] movement vectors of players. - `left_team_tired_factor` - N-elements vector of floats in the range {0..1}. 0 means player is not tired at all. - `left_team_yellow_card` - N-elements vector of integers denoting number of yellow cards a given player has (0 or 1). - - `left_team_active` - N-elements vector of Bools denoting whether a given player is playing the game (False means player got a red card). + - `left_team_active` - N-elements vector of booleans denoting whether a given player is playing the game (False means player got a red card). - `left_team_roles` - N-elements vector denoting roles of players. The meaning is: - `0` = e_PlayerRole_GK - goalkeeper, - `1` = e_PlayerRole_CB - centre back, @@ -63,7 +63,7 @@ Environment exposes following `raw` observations: - Screen: - `frame` - three vectors of RGB pixels representing rendered screen. It is only exposed when rendering is enabled (`render` flag). Size - of each vector is weight by height of the rendered window, 1280 by 720 by default. + of each vector is width by height of the rendered window, 1280 by 720 by default. Where `N` is the number of players on the team. @@ -115,7 +115,7 @@ player is less than 11) are set to -1. ### `extracted` (aka SMMWrapper) -Simplified spacial (minimap) representation of a game state. It consists of +Simplified spatial (minimap) representation of a game state. It consists of several 72 * 96 planes of bytes, filled in with 0s except for: * 1st plane: 255s represent positions of players on the left team @@ -148,7 +148,7 @@ The default action set consists of 19 actions: * Idle actions - * `action_idle` = 0, a no-op action, stickly actions are not affected (player maintains his directional movement etc.). + * `action_idle` = 0, a no-op action, sticky actions are not affected (player maintains his directional movement etc.). * Movement actions @@ -181,4 +181,4 @@ The default action set consists of 19 actions: It is an extension of the default action set: -* `action_builtin_ai` = 19, let game's built-in AI generate an action +* `action_builtin_ai` = 19, let game's built-in AI generate an action. diff --git a/gfootball/env/football_env_test.py b/gfootball/env/football_env_test.py index d2b3670b..2a096d48 100644 --- a/gfootball/env/football_env_test.py +++ b/gfootball/env/football_env_test.py @@ -25,6 +25,7 @@ import gfootball import os import platform +import sys import random import threading import atexit @@ -268,7 +269,14 @@ def test___render(self): # Linux expected_hash_value = 4000732293 if platform.system() == 'Windows': - expected_hash_value = 683941870 + # On Windows we may have to check four possible values: + # for each of architectures (32 or 64 bits) + # what SDK was used (latest or from Visual Studio 2017) + # We will check only two values once we start using windows-latest VM again + if sys.maxsize > 2 ** 32: # x64 + expected_hash_value = 683941870 if hash_value != 3676773624 else 3676773624 + else: # x86 + expected_hash_value = 1490754124 if hash_value != 2808421794 else 2808421794 elif platform.system() == 'Darwin': expected_hash_value = 1865563121 self.assertEqual(hash_value, expected_hash_value) diff --git a/gfootball/requirements.txt b/gfootball/requirements.txt deleted file mode 100644 index 116600e3..00000000 --- a/gfootball/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -pygame>=1.9.6 -opencv-python -psutil -scipy -gym>=0.11.0 -absl-py -wheel diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..6a3838c4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +# If you change any of the requirements here please don't forget to change them in setup.py too +pygame>=1.9.6 +opencv-python +psutil +scipy +gym>=0.11.0 +absl-py +wheel diff --git a/setup.py b/setup.py index 9f569696..81500efc 100644 --- a/setup.py +++ b/setup.py @@ -126,7 +126,7 @@ def run_windows(self): setup( name='gfootball', - version='2.10', + version='2.10.1', description=('Google Research Football - RL environment based on ' 'open-source game Gameplay Football'), long_description=('Please see [our GitHub page](https://github.com/google-research/football) ' @@ -138,6 +138,7 @@ def run_windows(self): license='Apache 2.0', packages=packages, package_dir={'gfootball_engine': 'third_party/gfootball_engine'}, + # If you change the requirements here please don't forget to change the requirements.txt too install_requires=[ 'pygame>=1.9.6', 'opencv-python', diff --git a/third_party/gfootball_engine/vcpkg_manifests/py3.6/vcpkg.json b/third_party/gfootball_engine/vcpkg_manifests/py3.6/vcpkg.json index b5e894ba..33af0d76 100644 --- a/third_party/gfootball_engine/vcpkg_manifests/py3.6/vcpkg.json +++ b/third_party/gfootball_engine/vcpkg_manifests/py3.6/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gfootball-engine", - "version-string": "2.10", - "builtin-baseline": "47d2378c8181ece05ffc51acd2ed60d97e3c9a64", + "version-string": "2.10.1", + "builtin-baseline": "8e0a801c6253a2c8e81f59427a4a5d66f10c0ca4", "dependencies": [ "python3", "boost-thread", diff --git a/third_party/gfootball_engine/vcpkg_manifests/py3.7/vcpkg.json b/third_party/gfootball_engine/vcpkg_manifests/py3.7/vcpkg.json index c9f917ac..c6b0992b 100644 --- a/third_party/gfootball_engine/vcpkg_manifests/py3.7/vcpkg.json +++ b/third_party/gfootball_engine/vcpkg_manifests/py3.7/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gfootball-engine", - "version-string": "2.10", - "builtin-baseline": "47d2378c8181ece05ffc51acd2ed60d97e3c9a64", + "version-string": "2.10.1", + "builtin-baseline": "8e0a801c6253a2c8e81f59427a4a5d66f10c0ca4", "dependencies": [ "python3", "boost-thread", diff --git a/third_party/gfootball_engine/vcpkg_manifests/py3.8/vcpkg.json b/third_party/gfootball_engine/vcpkg_manifests/py3.8/vcpkg.json index 7cf081ef..4b995b80 100644 --- a/third_party/gfootball_engine/vcpkg_manifests/py3.8/vcpkg.json +++ b/third_party/gfootball_engine/vcpkg_manifests/py3.8/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gfootball-engine", - "version-string": "2.10", - "builtin-baseline": "47d2378c8181ece05ffc51acd2ed60d97e3c9a64", + "version-string": "2.10.1", + "builtin-baseline": "8e0a801c6253a2c8e81f59427a4a5d66f10c0ca4", "dependencies": [ "python3", "boost-thread", diff --git a/third_party/gfootball_engine/vcpkg_manifests/py3.9/vcpkg.json b/third_party/gfootball_engine/vcpkg_manifests/py3.9/vcpkg.json index b395f643..eed0a4e2 100644 --- a/third_party/gfootball_engine/vcpkg_manifests/py3.9/vcpkg.json +++ b/third_party/gfootball_engine/vcpkg_manifests/py3.9/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gfootball-engine", - "version-string": "2.10", - "builtin-baseline": "47d2378c8181ece05ffc51acd2ed60d97e3c9a64", + "version-string": "2.10.1", + "builtin-baseline": "8e0a801c6253a2c8e81f59427a4a5d66f10c0ca4", "dependencies": [ "python3", "boost-thread",