Giter Club home page Giter Club logo

dino-bot's Introduction

Reinforcement Learning Model for Chrome Dino Game

This repository contains the implementation of a reinforcement learning (RL) model for training an agent to play the Chrome Dino game. The RL model is built using the DQN algorithm from the stable-baselines3 library. The trained model can learn to navigate and perform actions in the game environment to achieve high scores.

Game Environment

The Chrome Dino game is a popular side-scrolling game where the player controls a running dinosaur to avoid obstacles and collect points. The RL model interacts with the game environment, observes the game state, and takes actions to maximize the cumulative reward.

Dependencies

-Python 3.x
-PyTorch
-stable-baselines3

Installation

Clone this repository:

git clone https://github.com/nikithkb/Dino-bot.git cd Dino-bot

Download Chrome browser and go to chrome://dino

Usage:

To train the RL model on the Chrome Dino game, follow these steps:

Set up the game environment by opening the Chrome Dino game on full screen in Chrome browser. Make sure the game environment is running.

Configure the training parameters in the Jupyter notebook under the "Parameters" section, such as the number of training steps, batch size, and learning rate.

Run the training script:

Uncomment the first cell to finish installation of necessary packages for testing and training. Note: The Chrome window must be kept in maximised mode as to capture position of the dino

Results

The trained RL model achieves high scores and demonstrates the ability to navigate the Chrome Dino game environment effectively. It learns to avoid obstacles, collect points, and optimize its actions to maximize the cumulative reward.

Acknowledgements

This project is based on the stable-baselines3 library, which provides the implementation of the DQN algorithm and RL training utilities.

License

This project is licensed under the MIT License.

Feel free to provide any feedback or suggestions for improvement.

If you have any questions or run into any issues, please open an issue in the GitHub repository.

Happy gaming and happy RL training!

dino-bot's People

Contributors

nikithkb avatar

Watchers

 avatar

dino-bot's Issues

Storing High scores

The current model for Mr. Dino allows him to dodge solely based on the hazards in front. The main objective of Mr.Dino is to simply avoid obstacles. Your task is to make the model take in the high score and provide a bonus score for the model every time it beats it's previous high score.

Tips:

  • You may have to implement screen capture, do read the docs on the existing libraries used in the notebook
  • Make sure to adjust your window resolution accordingly for the capture

Reducing train times

The current model incorporates the DQN policy to train the model for Mr. DIno. However the train time is extensively long. The objective is to find optimisation techniques to reduce the train time and maintain the quality of the result. Feel free to try different policies or implementing a custom neural network to boost the accuracy as well as reduce train time.

Tips:

  • You can try looking into Farama's Gym library for more info
  • You can try capturing the aspect of the screen where the score is displayed

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.