diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5fff344f7..d17a9b423 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -24,7 +24,7 @@ If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. mac/linux/windows] - - Version [e.g. 1.4.3] + - Version [e.g. 1.5.0] **Additional context** Add any other context about the problem here. diff --git a/CMakeLists.txt b/CMakeLists.txt index be29840f4..e74aab78b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10.0) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version") -project(Griddly VERSION 1.4.3) +project(Griddly VERSION 1.5.0) set(BINARY ${CMAKE_PROJECT_NAME}) @@ -84,20 +84,20 @@ list(REMOVE_DUPLICATES GRIDDLY_INCLUDE_DIRS) if(WASM) list( - REMOVE_ITEM - GRIDDLY_SOURCES + REMOVE_ITEM + GRIDDLY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/SpriteObserver.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/BlockObserver.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/BlockObserver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/IsometricSpriteObserver.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/VulkanGridObserver.cpp ) list( - FILTER - GRIDDLY_SOURCES + FILTER + GRIDDLY_SOURCES EXCLUDE REGEX - "src/Griddly/Core/Observers/Vulkan/.*" + "src/Griddly/Core/Observers/Vulkan/.*" ) endif() @@ -105,7 +105,7 @@ endif() # Compile shaders and copy them into resources directory in build output if(NOT WASM) message(STATUS "Compiling shaders...") - find_package(Vulkan REQUIRED FATAL_ERROR) + find_package(Vulkan REQUIRED) if(MSVC) execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile_shaders.bat RESULT_VARIABLE rv) @@ -130,7 +130,7 @@ if(WASM) add_executable(griddlyjs ${JIDDLY_SOURCES} ) target_link_libraries(griddlyjs PRIVATE ${BINARY} yaml-cpp glm) - + # These properties specify what kind of Emscripten build to perform and are assigned to our 'a-simple-triangle' executable target. set_target_properties( griddlyjs diff --git a/README.md b/README.md index 90dc0a47a..834315d08 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,16 @@ A heavily optimized and flexible grid-world game engine for Game AI research. +# ![WHOOSH!!](resources/images/gvgai/oryx/tree2.png) Some Environments + +
+ + + +
+ +[Check out the full list of pre-built environments here](https://griddly.readthedocs.io/en/latest/games/index.html) + # ![BOOM](resources/images/gvgai/oryx/sparkle3.png) Some features * Design and build game mechanics using a simple YAML-based language: [GDY](https://griddly.readthedocs.io/en/latest/getting-started/gdy/index.html) * **Fast execution speed** environments can run up to 70k FPS on a single thread. @@ -35,18 +45,6 @@ A heavily optimized and flexible grid-world game engine for Game AI research. * Integration with [Wandb](https://griddly.readthedocs.io/en/latest/rllib/intro/index.html#weights-and-biases-wandb) -# ![WHOOSH!!](resources/images/gvgai/oryx/tree2.png) Some Environments - -
- - - -
- -[Check out the full list of pre-built environments here](https://griddly.readthedocs.io/en/latest/games/index.html) - - - # ![Community](resources/images/oryx/oryx_fantasy/avatars/doggo1.png) Community Join the [Discord community](https://discord.gg/xuR8Dsv) for help and to talk about what you are doing with Griddly! @@ -80,9 +78,18 @@ The most awesome part of Griddly is the ability to easily customize and build yo ## [Custom Shaders](https://griddly.readthedocs.io/en/latest/tutorials/Custom%20Shaders/index.html) * Customize rendering for environments using SPIR-V shaders.
- - - +
+

Global Lighting

+ +
+
+

Health Bars

+ +
+
+

Per-Object Lighting

+ +
# ![Installing](resources/images/gvgai/oryx/hammer1.png) Installing diff --git a/bindings/python.cpp b/bindings/python.cpp index 50236c9f6..e3939f0b2 100644 --- a/bindings/python.cpp +++ b/bindings/python.cpp @@ -12,7 +12,7 @@ namespace griddly { PYBIND11_MODULE(python_griddly, m) { m.doc() = "Griddly python bindings"; - m.attr("version") = "1.4.3"; + m.attr("version") = "1.5.0"; #ifndef NDEBUG spdlog::set_level(spdlog::level::debug); diff --git a/docs/conf.py b/docs/conf.py index c3ce01d1d..ae2f4a33b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'Chris Bamford' # The full version, including alpha/beta/rc tags -release = '1.4.3' +release = '1.5.0' # -- General configuration --------------------------------------------------- diff --git a/docs/img/logo.png b/docs/img/logo.png new file mode 100644 index 000000000..f3df04f21 Binary files /dev/null and b/docs/img/logo.png differ diff --git a/docs/index.rst b/docs/index.rst index 91bbfc87e..ba1a60759 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ Griddly Docs ============ -.. image:: img/griddly-header.png +.. image:: img/logo.png Griddly documentation. diff --git a/js/griddlyjs-app/favicon.ico b/js/griddlyjs-app/favicon.ico index 6db23a410..1f8810214 100644 Binary files a/js/griddlyjs-app/favicon.ico and b/js/griddlyjs-app/favicon.ico differ diff --git a/js/griddlyjs-app/package-lock.json b/js/griddlyjs-app/package-lock.json index 9104d490f..6900ca1d9 100644 --- a/js/griddlyjs-app/package-lock.json +++ b/js/griddlyjs-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "griddlyjs-app", - "version": "1.4.3", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "griddlyjs-app", - "version": "1.4.3", + "version": "1.5.0", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-brands-svg-icons": "^6.1.1", diff --git a/js/griddlyjs-app/package.json b/js/griddlyjs-app/package.json index f38aa3eb8..ef4835055 100644 --- a/js/griddlyjs-app/package.json +++ b/js/griddlyjs-app/package.json @@ -1,6 +1,6 @@ { "name": "griddlyjs-app", - "version": "1.4.3", + "version": "1.5.0", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.1.1", diff --git a/js/griddlyjs-app/public/Griddly_Social_1280x720.png b/js/griddlyjs-app/public/Griddly_Social_1280x720.png new file mode 100644 index 000000000..880871cd1 Binary files /dev/null and b/js/griddlyjs-app/public/Griddly_Social_1280x720.png differ diff --git a/js/griddlyjs-app/public/Griddly_Social_2400x1080.png b/js/griddlyjs-app/public/Griddly_Social_2400x1080.png new file mode 100644 index 000000000..afe14c064 Binary files /dev/null and b/js/griddlyjs-app/public/Griddly_Social_2400x1080.png differ diff --git a/js/griddlyjs-app/public/favicon.ico b/js/griddlyjs-app/public/favicon.ico index 6db23a410..1f8810214 100644 Binary files a/js/griddlyjs-app/public/favicon.ico and b/js/griddlyjs-app/public/favicon.ico differ diff --git a/js/griddlyjs-app/public/griddlybear.png b/js/griddlyjs-app/public/griddlybear.png new file mode 100644 index 000000000..a4c750d4b Binary files /dev/null and b/js/griddlyjs-app/public/griddlybear.png differ diff --git a/js/griddlyjs-app/public/griddlybear192x192.png b/js/griddlyjs-app/public/griddlybear192x192.png deleted file mode 100644 index 91ed820f0..000000000 Binary files a/js/griddlyjs-app/public/griddlybear192x192.png and /dev/null differ diff --git a/js/griddlyjs-app/public/griddlybear512x512.png b/js/griddlyjs-app/public/griddlybear512x512.png deleted file mode 100644 index 600f9875c..000000000 Binary files a/js/griddlyjs-app/public/griddlybear512x512.png and /dev/null differ diff --git a/js/griddlyjs-app/public/index.html b/js/griddlyjs-app/public/index.html index ecc17318e..1178c18d2 100644 --- a/js/griddlyjs-app/public/index.html +++ b/js/griddlyjs-app/public/index.html @@ -10,14 +10,14 @@ - + - + - GriddlyJS + Griddly AI diff --git a/js/griddlyjs-app/public/intro/debuggingmechanics_updated.gif b/js/griddlyjs-app/public/intro/debuggingmechanics_updated.gif new file mode 100644 index 000000000..28078d427 Binary files /dev/null and b/js/griddlyjs-app/public/intro/debuggingmechanics_updated.gif differ diff --git a/js/griddlyjs-app/public/intro/debugpolicies_updated.gif b/js/griddlyjs-app/public/intro/debugpolicies_updated.gif new file mode 100644 index 000000000..733f3b9c4 Binary files /dev/null and b/js/griddlyjs-app/public/intro/debugpolicies_updated.gif differ diff --git a/js/griddlyjs-app/public/intro/intro_updated.gif b/js/griddlyjs-app/public/intro/intro_updated.gif new file mode 100644 index 000000000..80cbd55f0 Binary files /dev/null and b/js/griddlyjs-app/public/intro/intro_updated.gif differ diff --git a/js/griddlyjs-app/public/intro/leveleditor_updated.gif b/js/griddlyjs-app/public/intro/leveleditor_updated.gif new file mode 100644 index 000000000..2e0b3b9b9 Binary files /dev/null and b/js/griddlyjs-app/public/intro/leveleditor_updated.gif differ diff --git a/js/griddlyjs-app/public/intro/newproject_updated.gif b/js/griddlyjs-app/public/intro/newproject_updated.gif new file mode 100644 index 000000000..bf693a56a Binary files /dev/null and b/js/griddlyjs-app/public/intro/newproject_updated.gif differ diff --git a/js/griddlyjs-app/public/intro/recordingtrajectories_updated.gif b/js/griddlyjs-app/public/intro/recordingtrajectories_updated.gif new file mode 100644 index 000000000..d1b423d0e Binary files /dev/null and b/js/griddlyjs-app/public/intro/recordingtrajectories_updated.gif differ diff --git a/js/griddlyjs-app/public/loading.gif b/js/griddlyjs-app/public/loading.gif new file mode 100644 index 000000000..23e205a92 Binary files /dev/null and b/js/griddlyjs-app/public/loading.gif differ diff --git a/js/griddlyjs-app/public/logo.png b/js/griddlyjs-app/public/logo.png index 3a6008166..f3df04f21 100644 Binary files a/js/griddlyjs-app/public/logo.png and b/js/griddlyjs-app/public/logo.png differ diff --git a/js/griddlyjs-app/public/logo1200x630.png b/js/griddlyjs-app/public/logo1200x630.png deleted file mode 100644 index e80720e3e..000000000 Binary files a/js/griddlyjs-app/public/logo1200x630.png and /dev/null differ diff --git a/js/griddlyjs-app/public/logo800x418.png b/js/griddlyjs-app/public/logo800x418.png deleted file mode 100644 index ad985d718..000000000 Binary files a/js/griddlyjs-app/public/logo800x418.png and /dev/null differ diff --git a/js/griddlyjs-app/public/logo_ai_white.png b/js/griddlyjs-app/public/logo_ai_white.png new file mode 100644 index 000000000..a89c6547f Binary files /dev/null and b/js/griddlyjs-app/public/logo_ai_white.png differ diff --git a/js/griddlyjs-app/public/logo_white.png b/js/griddlyjs-app/public/logo_white.png new file mode 100644 index 000000000..073844c87 Binary files /dev/null and b/js/griddlyjs-app/public/logo_white.png differ diff --git a/js/griddlyjs-app/public/manifest.json b/js/griddlyjs-app/public/manifest.json index febb9434e..727d72462 100644 --- a/js/griddlyjs-app/public/manifest.json +++ b/js/griddlyjs-app/public/manifest.json @@ -8,14 +8,9 @@ "type": "image/x-icon" }, { - "src": "griddlybear192x192.png", + "src": "griddlybear.png", "type": "image/png", - "sizes": "192x192" - }, - { - "src": "griddlybear512x512.png", - "type": "image/png", - "sizes": "512x512" + "sizes": "192x192 512x512" } ], "start_url": ".", diff --git a/js/griddlyjs-app/src/App.js b/js/griddlyjs-app/src/App.js index ad00b03c8..21ac62fe1 100644 --- a/js/griddlyjs-app/src/App.js +++ b/js/griddlyjs-app/src/App.js @@ -22,6 +22,7 @@ import { NavItem, Modal, Form, + Spinner, } from "react-bootstrap"; import { @@ -55,15 +56,15 @@ class App extends Component { this.state = { levelPlayer: { phaserWidth: 500, - phaserHeight: 300, + phaserHeight: 250, }, levelEditor: { phaserWidth: 500, - phaserHeight: 300, + phaserHeight: 250, }, policyDebugger: { phaserWidth: 500, - phaserHeight: 300, + phaserHeight: 250, }, levelSelector: { phaserWidth: 1000, @@ -589,15 +590,15 @@ class App extends Component { ...state, levelPlayer: { phaserWidth: width, - phaserHeight: (6 * window.innerHeight) / 8, + phaserHeight: (6 * window.innerHeight) / 9, }, levelEditor: { phaserWidth: width, - phaserHeight: (6 * window.innerHeight) / 8, + phaserHeight: (6 * window.innerHeight) / 9, }, policyDebugger: { phaserWidth: width, - phaserHeight: (6 * window.innerHeight) / 8, + phaserHeight: (6 * window.innerHeight) / 9, }, levelSelector: { phaserWidth: (2 * window.innerWidth) / 3, @@ -783,8 +784,10 @@ class App extends Component { - Loading Project..... + loading + + Loading Project... Griddly Bear diff --git a/js/griddlyjs-app/src/App.scss b/js/griddlyjs-app/src/App.scss index 17779be89..cf6e613bb 100644 --- a/js/griddlyjs-app/src/App.scss +++ b/js/griddlyjs-app/src/App.scss @@ -67,3 +67,11 @@ text-align: left; font-family: monospace; } + +.loading-gif { + margin: auto; +} + +.loading-logo { + margin: auto; +} \ No newline at end of file diff --git a/js/griddlyjs-app/src/GDYEditor.js b/js/griddlyjs-app/src/GDYEditor.js index 4a5fa7ed7..80cc50cbe 100644 --- a/js/griddlyjs-app/src/GDYEditor.js +++ b/js/griddlyjs-app/src/GDYEditor.js @@ -120,7 +120,7 @@ class GDYEditor extends Component { path={file.name} value={file.value} language={file.language} - height="80vh" + height="70vh" // options={{fontSize: "20"}} theme="vs-dark" onMount={this.handleEditorDidMount} diff --git a/js/griddlyjs-app/src/Intro.js b/js/griddlyjs-app/src/Intro.js index 68f447739..ec14620cb 100644 --- a/js/griddlyjs-app/src/Intro.js +++ b/js/griddlyjs-app/src/Intro.js @@ -16,7 +16,7 @@ class Intro extends Component { this.slides = [ { title: "Introduction", - image: "intro/intro.gif", + image: "intro/intro_updated.gif", content: (
Welcome to GriddlyJS
@@ -33,7 +33,7 @@ class Intro extends Component { }, { title: "Managing projects", - image: "intro/newproject.gif", + image: "intro/newproject_updated.gif", content: (
@@ -80,7 +80,7 @@ class Intro extends Component { }, { title: "Level Editor", - image: "intro/leveleditor.gif", + image: "intro/leveleditor_updated.gif", content: (
@@ -134,7 +134,7 @@ class Intro extends Component { }, { title: "Debugging Mechanics", - image: "intro/debuggingmechanics.gif", + image: "intro/debuggingmechanics_updated.gif", content: (
@@ -171,7 +171,7 @@ class Intro extends Component { }, { title: "Recording Trajectories", - image: "intro/recordingtrajectories.gif", + image: "intro/recordingtrajectories_updated.gif", content: (
@@ -207,7 +207,7 @@ class Intro extends Component { }, { title: "Debugging Policies", - image: "intro/debugpolicies.gif", + image: "intro/debugpolicies_updated.gif", content: (
diff --git a/python/griddly/GymWrapper.py b/python/griddly/GymWrapper.py index 8e48911d6..36295ec95 100644 --- a/python/griddly/GymWrapper.py +++ b/python/griddly/GymWrapper.py @@ -17,8 +17,8 @@ def __init__(self): self.player_observation_space = None self.global_observation_space = None self.action_space_parts = None - self.max_action_ids = 0 - self.num_action_ids = {} + self.max_action_ids = None + self.num_action_ids = None self.action_space = None self.object_names = None self.variable_names = None @@ -125,19 +125,19 @@ def __init__( @property def player_count(self): - if not self._cache.player_count: + if self._cache.player_count is None: self._cache.player_count = self.gdy.get_player_count() return self._cache.player_count @property def level_count(self): - if not self._cache.level_count: + if self._cache.level_count is None: self._cache.level_count = self.gdy.get_level_count() return self._cache.level_count @property def avatar_object(self): - if not self._cache.avatar_object: + if self._cache.avatar_object is None: self._cache.avatar_object = self.gdy.get_avatar_object() return self._cache.avatar_object @@ -147,13 +147,13 @@ def has_avatar(self): @property def action_input_mappings(self): - if not self._cache.action_input_mappings: + if self._cache.action_input_mappings is None: self._cache.action_input_mappings = self.gdy.get_action_input_mappings() return self._cache.action_input_mappings @property def action_names(self): - if not self._cache.action_names: + if self._cache.action_names is None: self._cache.action_names = self.gdy.get_action_names() return self._cache.action_names @@ -167,25 +167,25 @@ def default_action_name(self): @property def object_names(self): - if not self._cache.object_names: + if self._cache.object_names is None: self._cache.object_names = self.game.get_object_names() return self._cache.object_names @property def variable_names(self): - if not self._cache.variable_names: + if self._cache.variable_names is None: self._cache.variable_names = self.game.get_object_variable_names() return self._cache.variable_names @property def _vector2rgb(self): - if not self._cache.vector2rgb: + if self._cache.vector2rgb is None: self._cache.vector2rgb = Vector2RGB(10, len(self.object_names)) return self._cache.vector2rgb @property def global_observation_space(self): - if not self._cache.global_observation_space: + if self._cache.global_observation_space is None: self._cache.global_observation_space = self._get_obs_space( self.game.get_global_observation_description(), self._global_observer_type @@ -194,7 +194,7 @@ def global_observation_space(self): @property def player_observation_space(self): - if not self._cache.player_observation_space: + if self._cache.player_observation_space is None: if self.player_count == 1: self._cache.player_observation_space = self._get_obs_space( self._players[0].get_observation_description(), @@ -203,7 +203,6 @@ def player_observation_space(self): else: observation_spaces = [] for p in range(self.player_count): - observation_description = self._players[p].get_observation_description() observation_spaces.append( self._get_obs_space( self._players[p].get_observation_description(), @@ -220,25 +219,25 @@ def observation_space(self): @property def max_action_ids(self): - if not self._cache.max_action_ids: + if self._cache.max_action_ids is None: self._init_action_variable_cache() return self._cache.max_action_ids @property def num_action_ids(self): - if not self._cache.num_action_ids: + if self._cache.num_action_ids is None: self._init_action_variable_cache() return self._cache.num_action_ids @property def action_space_parts(self): - if not self._cache.action_space_parts: + if self._cache.action_space_parts is None: self._init_action_variable_cache() return self._cache.action_space_parts @property def action_space(self): - if not self._cache.action_space: + if self._cache.action_space is None: self._cache.action_space = self._create_action_space() return self._cache.action_space @@ -518,14 +517,18 @@ def _init_action_variable_cache(self): if self.action_count > 1: self._cache.action_space_parts.append(self.action_count) + self._cache.num_action_ids = {} + max_action_ids = 0 + for action_name, mapping in sorted(self.action_input_mappings.items()): if not mapping["Internal"]: num_action_ids = len(mapping["InputMappings"]) + 1 self._cache.num_action_ids[action_name] = num_action_ids - if self._cache.max_action_ids < num_action_ids: - self._cache.max_action_ids = num_action_ids + if max_action_ids < num_action_ids: + max_action_ids = num_action_ids - self._cache.action_space_parts.append(self.max_action_ids) + self._cache.max_action_ids = max_action_ids + self._cache.action_space_parts.append(max_action_ids) def clone(self): """ diff --git a/python/griddly/util/rllib/environment/core.py b/python/griddly/util/rllib/environment/core.py index 860466a32..a984bae27 100644 --- a/python/griddly/util/rllib/environment/core.py +++ b/python/griddly/util/rllib/environment/core.py @@ -12,6 +12,15 @@ ) +class _RLlibEnvCache: + def __init__(self): + self.action_space = None + self.observation_space = None + + def reset(self): + self.__init__() + + class RLlibEnv(GymWrapper): """ Wraps a Griddly environment for compatibility with RLLib. @@ -48,6 +57,7 @@ class RLlibEnv(GymWrapper): def __init__(self, env_config): super().__init__(**env_config) + self._rllib_cache = _RLlibEnvCache() self.env_steps = 0 self._env_idx = None self._worker_idx = None @@ -128,23 +138,30 @@ def _after_step(self, observation, reward, done, info): return extra_info - def set_transform(self): - """ - Create the transform for rllib based on the observation space - """ - - if self.player_count > 1: - self.observation_space = self.observation_space[0] - self.action_space = self.action_space[0] + @property + def action_space(self): + if self._rllib_cache.action_space is None: + self._rllib_cache.action_space = super().action_space[0] if self.player_count > 1 else super().action_space + return self._rllib_cache.action_space + + @property + def observation_space(self): + if self._rllib_cache.observation_space is None: + obs_space = super().observation_space[0] if self.player_count > 1 else super().observation_space + self._rllib_cache.observation_space = gym.spaces.Box( + obs_space.low.transpose((1, 2, 0)).astype(np.float), + obs_space.high.transpose((1, 2, 0)).astype(np.float), + dtype=np.float, + ) + return self._rllib_cache.observation_space - self.observation_space = gym.spaces.Box( - self.observation_space.low.transpose((1, 2, 0)).astype(np.float), - self.observation_space.high.transpose((1, 2, 0)).astype(np.float), - dtype=np.float, - ) + @property + def width(self): + return self.observation_space.shape[0] - self.height = self.observation_space.shape[1] - self.width = self.observation_space.shape[0] + @property + def height(self): + return self.observation_space.shape[1] def _get_valid_action_trees(self): valid_action_trees = self.game.build_valid_action_trees() @@ -159,8 +176,8 @@ def reset(self, **kwargs): elif self._random_level_on_reset: kwargs["level_id"] = np.random.choice(self.level_count) + self._rllib_cache.reset() observation = super().reset(**kwargs) - self.set_transform() if self.generate_valid_action_trees: self.last_valid_action_trees = self._get_valid_action_trees() diff --git a/python/requirements.txt b/python/requirements.txt index 447dc7f60..bd865736e 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -7,4 +7,5 @@ matplotlib>=3.3.3 pyglet pytest>=6.2.1 black - +ray[rllib] +torch diff --git a/python/setup.py b/python/setup.py index 719530047..baab413d8 100644 --- a/python/setup.py +++ b/python/setup.py @@ -71,7 +71,7 @@ def griddly_package_data(config='Debug'): setup( name='griddly', - version="1.4.3", + version="1.5.0", author_email="chrisbam4d@gmail.com", description="Griddly Python Libraries", long_description=long_description, diff --git a/python/tests/rllib_test.py b/python/tests/rllib_test.py new file mode 100644 index 000000000..eb203eb12 --- /dev/null +++ b/python/tests/rllib_test.py @@ -0,0 +1,60 @@ +import os +import sys +import ray + +from ray import tune +from ray.rllib.agents.impala import ImpalaTrainer +from ray.rllib.models import ModelCatalog +from ray.tune.registry import register_env + +from griddly import gd +from griddly.util.rllib.torch import GAPAgent +from griddly.util.rllib.environment.core import RLlibEnv + + +def test_rllib_env(): + sep = os.pathsep + os.environ['PYTHONPATH'] = sep.join(sys.path) + + ray.init(num_gpus=0) + + env_name = "ray-griddly-env" + + register_env(env_name, RLlibEnv) + ModelCatalog.register_custom_model("GAP", GAPAgent) + + max_training_steps = 1 + + config = { + 'framework': 'torch', + 'num_workers': 1, + 'num_envs_per_worker': 1, + 'num_gpus': 0, + 'model': { + 'custom_model': 'GAP', + 'custom_model_config': {} + }, + 'env': env_name, + 'env_config': { + 'random_level_on_reset': True, + 'yaml_file': 'Single-Player/GVGAI/clusters_partially_observable.yaml', + 'global_observer_type': gd.ObserverType.VECTOR, + 'max_steps': 100, + }, + 'entropy_coeff_schedule': [ + [0, 0.01], + [max_training_steps, 0.0] + ], + 'lr_schedule': [ + [0, 0.0005], + [max_training_steps, 0.0] + ] + } + + stop = { + "timesteps_total": max_training_steps, + } + + result = tune.run(ImpalaTrainer, config=config, stop=stop) + + assert result is not None diff --git a/resources/griddlybear192x192.png b/resources/griddlybear192x192.png deleted file mode 100644 index 91ed820f0..000000000 Binary files a/resources/griddlybear192x192.png and /dev/null differ diff --git a/resources/griddlybear512x512.png b/resources/griddlybear512x512.png deleted file mode 100644 index 600f9875c..000000000 Binary files a/resources/griddlybear512x512.png and /dev/null differ diff --git a/resources/griddlybear64x64.png b/resources/griddlybear64x64.png deleted file mode 100644 index 0178c0ef3..000000000 Binary files a/resources/griddlybear64x64.png and /dev/null differ diff --git a/resources/logo.png b/resources/logo.png index 3a6008166..f3df04f21 100644 Binary files a/resources/logo.png and b/resources/logo.png differ diff --git a/resources/logo1200x630.png b/resources/logo1200x630.png deleted file mode 100644 index e80720e3e..000000000 Binary files a/resources/logo1200x630.png and /dev/null differ diff --git a/resources/logo800x418.png b/resources/logo800x418.png deleted file mode 100644 index ad985d718..000000000 Binary files a/resources/logo800x418.png and /dev/null differ