Dodge-the-Blocks is an experimental project, i created to learn reinforcement learning algorithms on customizable environment, as beginner(holds true for today also) i was curious how the behaviour of agent will change if number of states available to it change and how does agent learning pattern agent in a markov decision algorithm in Q-Learning algorithm
The game support users also to play themselves but it becomes very hard unless you make some bot or something to score past 15 i think! The current setup for agent has only two types of state defined for it
- three-state-system : In this state detection approach, state of agent is decided depending on relative posistion of safe position wrt to agent's current position and accordingly a state is assigned to the agent
- `0` (Safe block is left to current position of agent)
- `1` (Safe block is just above the current position of agent)
- `2` (Safe block is right to current position of agent)
If you want to give it a try you can clone the project
git clone https://github.com/indiVar0508/Dodge-the-Blocks.git
Install the requirements into your Python virtual environment, make sure you are in Dodge-the-Blocks
directory
python3 -m venv venv # create virtual environment
source venv/bin/activate # activate virtual environment in terminal
pip install -r requirements.txt
you can check CLI option to run from Terminal to run game in various mode (play yourself vs let the RL agent play) use the command python dodge_the_blocks/main.py -h
to check options available
Run Game as per User's preference
optional arguments:
-h, --help show this help message and exit
--use_agent use_agent specify state for agent to play in 3 state vs 25 state
To run game for yourself use run the command python dodge_the_blocks/main.py
, if you want to let agent learn and play the game use optional argument --use_agent
which only expects 3 or 25 as valid states for agent