Git Product home page Git Product logo

halo's Introduction

halo

This is a reinforcement agent for the video game, Halo Combat Evolved (2001).

This is a Python program that uses PyAutoGUI and OpenCV to train an agent to play the game Halo using reinforcement learning. The agent is a neural network that takes in game states (screenshots of the game) as input and outputs actions to take in the game. The agent is trained using the Q-learning algorithm, and the game environment is simulated using the HaloEnv class. The program allows the user to control the game using WASD keys and the mouse, and it also allows the user to reset the game and to quit the program.

To use this program, you will need to have the following libraries installed:

PyAutoGUI OpenCV NumPy PyTorch To run the program, clone this repository and navigate to the root directory in your terminal. Then, run the following command:

Copy code python halo.py Features Trains an agent to play the game using reinforcement learning Allows the user to control the game using WASD keys and the mouse Allows the user to reset the game and to quit the program Uses PyAutoGUI and OpenCV to simulate the game environment and to capture game states Uses a neural network to model the agent and the Q-learning algorithm to train the agent Example To see an example of the agent in action, run the following command:

Copy code python halo.py --demo This will run the agent in demo mode, where it will use the trained model to play the game. The agent will take actions in the game based on its predictions of the optimal actions to take given the current game state. You can watch the agent play the game and see how it performs.

Training To train the agent yourself, run the following command:

Copy code python halo.py --train This will run the agent in training mode, where it will learn to play the game by interacting with the game environment and learning from its mistakes. The training process can take a while, depending on the complexity of the game and the size of the neural network. You can stop the training at any time by pressing the 'q' key.

Configuration You can configure the behavior of the agent by modifying the hyperparameters in the halo.py file. Some of the key hyperparameters include:

learning rate discount factor exploration rate number of epochs batch size By adjusting these hyperparameters, you can fine-tune the behavior of the agent and improve its performance.

Limitations This program is intended for educational purposes only, and it is not a commercial product. As such, it may have some limitations and may not work perfectly in all cases. Some potential limitations include:

Compatibility with different versions of the game or with different operating systems Performance issues due to the complexity of the game or the size of the neural network Unforeseen bugs or issues due to the nature of the program If you encounter any issues while using this program, please open an issue on GitHub and we will do our best to help.

halo's People

Contributors

terracraft321 avatar

Stargazers

Kannan v2 avatar

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.