Code Monkey home page Code Monkey logo

baba-is-auto's Introduction

baba-is-auto

License Windows Ubuntu macOS

codecov Codacy Badge CodeFactor

Quality Gate Status Lines of Code Maintainability Rating Reliability Rating Security Rating

baba-is-auto is Baba Is You simulator using C++ with some reinforcement learning. The code is built on C++17 and can be compiled with commonly available compilers such as g++, clang++, or Microsoft Visual Studio. baba-is-auto currently supports macOS (10.14 or later), Ubuntu (18.04 or later), Windows (Visual Studio 2017 or later), and Windows Subsystem for Linux (WSL). Other untested platforms that support C++17 also should be able to build baba-is-auto.

What is "Baba Is You"?

Baba Is You is an award-winning puzzle game where you can change the rules by which you play. In every level, the rules themselves are present as blocks you can interact with; by manipulating them, you can change how the level works and cause surprising, unexpected interactions! With some simple block-pushing you can turn yourself into a rock, turn patches of grass into dangerously hot obstacles, and even change the goal you need to reach to something entirely different.

Key Features

  • C++17 based Baba Is You library
  • Various RL environments based on OpenAI Gym
  • GUI simulator using pygame
  • C++ and Python API

Environments

  • Action Space

    • UP
    • DOWN
    • LEFT
    • RIGHT
  • Reward

    • Failed : -100 points
    • Solved : +200 points
    • Each action : -0.5 points

Algorithms

Quick Start

You will need CMake to build the code. If you're using Windows, you need Visual Studio 2017 in addition to CMake.

First, clone the code:

git clone https://github.com/utilForever/baba-is-auto.git --recursive
cd baba-is-auto

C++ API

For macOS or Linux or Windows Subsystem for Linux (WSL):

mkdir build
cd build
cmake ..
make

For Windows:

mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64"
MSBuild baba-is-auto.sln /p:Configuration=Release

Python API

Build and install the package by running

pip install -U .

Docker

docker pull utilforever/baba-is-auto:latest

Documentation

TBA

How To Contribute

Contributions are always welcome, either reporting issues/bugs or forking the repository and then issuing pull requests when you have completed some additional coding that you feel will be beneficial to the main project. If you are interested in contributing in a more dedicated capacity, then please contact me.

Contact

You can contact me via e-mail (utilForever at gmail.com). I am always happy to answer questions or help with any issues you might have, and please be sure to share any additional work or your creations with me, I love seeing what other people are making.

Acknowledgement

I would like to thank Arvi "Hempuli" Teikari for allowing me to develop this project.

License

The class is licensed under the MIT License:

Copyright © 2020-2023 Chris Ohk.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Baba Is You was created by Arvi "Hempuli" Teikari, a Finnish game developer known for other titles such as Environmental Station Alpha and Stumblehill.

baba-is-auto's People

Contributors

utilforever 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

baba-is-auto's Issues

Make GUI program

I'll make a simple GUI program to test the result of Reinforcement Learning with DQN.

Update GitHub Actions Images

  • Ubuntu 18.04 is deleted. Therefore, I'll add Ubuntu 22.04.
  • gcc-9 in macOS is deleted. Therefore, I'll add gcc-12.

Icons spread when they are stacked at the end of map

In 'off limits' map, walls are not overlapped when walls are stacked at the end of the map. In original "Baba is you" game, when I play the same map, the stacked walls move like a single block. But they spread out here.

172770860-5eb064e7-7189-46ca-99fe-fd5541afe406

Icon vanishing problem while moving multiple players

Hello, I implemented "off limits" map and tested it, but when I move player after rule 'wall is you' is created, some walls are vanishing (shown in gif). I think there is problem when walls are overlaped.

ezgif com-gif-maker
.

Python API

We'll implement Python API using pybind11 to make gym-based environment and DQN.

Fix GIFImage code

I checked that pygame >= 2.0.0 not supports set_palette in SDL 2. I should resolve this problem.

Python error AssertionError: Observation space ... does not inherit from gym.spaces.Space

(dev) [nickp@m1 baba-babaisyou-v0 (main)]$ python3 DQN.py 
Traceback (most recent call last):
  File "DQN.py", line 16, in <module>
    env = gym.make('baba-babaisyou-v0')
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/envs/registration.py", line 601, in make
    env = PassiveEnvChecker(env)
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 25, in __init__
    check_observation_space(env.action_space)
  File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 145, in check_observation_space
    f"Observation space ({observation_space}) does not inherit from gym.spaces.Space"
AssertionError: Observation space ([<Direction.UP: 1>, <Direction.DOWN: 2>, <Direction.LEFT: 3>, <Direction.RIGHT: 4>]) does not inherit from gym.spaces.Space
Python 3.7.10
gym.__version__ = '0.24.1'

Implement game

We'll make the game that can move an object and parse rules.

Initial project setup

  • Setup CMake build system
  • Setup unit test system (doctest)
  • Setup coding style format (clang-format)

Refactor code

I'll refactor code to improve architecture and readability.

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.